package com.ruoyi.teaching.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Map;

/**
 * @author 15332
 * @version 1.0
 * @date 2025/9/15 19:14
 * @description canal队列中的json定制
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CanalHighInterviewDTO {
  private List<Data> data;
  private String database;
  private Long es;
  private String gtid;
  private Integer id;
  private Boolean isDdl;
  private Map<String, String> mysqlType;
  private List<Old> old;
  private List<String> pkNames;
  private String sql;
  private Map<String, Integer> sqlType;
  private String table;
  private Long ts;
  private String type;

  @lombok.Data
  @AllArgsConstructor
  @NoArgsConstructor
  @JsonIgnoreProperties(ignoreUnknown = true)
  public static class Data {
    private String id;
    private String stage;
    private String question;
    private String answer;
    @JsonProperty("knowledge_point")
    private String knowledgePoint;
    private String importance;
    @JsonProperty("create_by")
    private String createBy;
    @JsonProperty("create_time")
    private String createTime;
    @JsonProperty("update_by")
    private String updateBy;
    @JsonProperty("update_time")
    private String updateTime;
    private String remark;
  }

  @lombok.Data
  @AllArgsConstructor
  @NoArgsConstructor
  @JsonIgnoreProperties(ignoreUnknown = true)
  public static class Old {
    private String question;
    private String importance;
  }
}
